//
//  WeChat.h
//  BrushFace
//
//  Created by timer_q on 15/12/18.
//  Copyright © 2015年 Zzz. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "WXApi.h"
#import "WXApiObject.h"

//测试微信

#define kWXSecret @"96986816f66641db67d2726ad0278ea7"
#define kWXAppId @"wxcf4c41fcb5c3f510"


//#define kWXSecret @"97cc929e1d696cc4319e7d9e937aff46"
//#define kWXAppId @"wx95eab3e6fbc39206"

//微信demo
//#define kWXSecret @"97cc929e1d696cc4319e7d9e937aff46"
//#define kWXAppId @"wxb4ba3c02aa476ea1"

typedef void(^AccessTokenCb)(id result);
typedef void(^AuthRequestCb)(id result);

@interface WeChat : NSObject<WXApiDelegate>
@property (nonatomic, strong, readonly) BaseResp *baseResp;
@property (nonatomic, strong, readonly) SendAuthResp *loginResp;
@property (nonatomic, strong, readonly) NSMutableDictionary *accessTokenRsDict;
AS_SINGLETON(WeChat)


/**
 *  微信支付
 *
 *  @param partnerId appid
 *  @param prepayId  订单id
 *  @param nonceStr  随机串
 *  @param timeStamp 时间戳
 *  @param sign      验证
 */
+ (void)sendOrderToWeChatWithPartnerId:(NSString *)partnerId andPrepayId:(NSString *)prepayId andNonceStr:(NSString *)nonceStr andTimeStamp:(NSString *)timeStamp andSign:(NSString *)sign;

/**
 *微信登录:获取微信授权
 */
-(void)sendAuthRequest:(AuthRequestCb)cb;
///**
// *微信登录:获取微信授权返回
// */
//- (void)authRequestBack;
//
@end

@interface WeChatParseHelper : NSObject
+ (NSString *)getAuthRsAccessToken:(id)rs;


@end